package com.grm.sys.controller;

import com.grm.common.Result;
import com.grm.sys.entity.LoginUserInfo;
import com.grm.sys.service.HomeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 首页控制器，加载用户信息和所拥有的菜单列表
 *
 * @author gaorimao
 * @date 2022/02/10
 */
@Slf4j
@RestController
public class HomeController {
    @Autowired
    private HomeService homeService;

    @GetMapping("/home")
    public Result home() {
        LoginUserInfo loginUserInfo = homeService.getHome();
        return Result.success("加载登录用户信息成功！", loginUserInfo);
    }
}
